from pdf_craft import PDFPageExtractor, MarkDownWriter
 
extractor = PDFPageExtractor(
    device="cpu",  # 如果使用 GPU，请修改为 device="cuda:0"
    model_dir_path="/path/to/model/dir/path"  # AI 模型下载和安装的文件夹地址
)
 
with MarkDownWriter(markdown_path, "images", "utf-8") as md:
    for block in extractor.extract(pdf="/path/to/pdf/file"):
        md.write(block)

 